import java.util.Locale;

public class Test {
    public static void main(String[] args) {
        String s1="HelloWorld";

        StringBuffer s2=new StringBuffer();
        for (int i = 0; i < s1.length(); i++) {
            if(s1.charAt(i)>='a'&&s1.charAt(i)<='z'){
             String s=s1.charAt(i)+"";
             String s3=s.toUpperCase();
                    s2.append(s3);
            }else if(s1.charAt(i)>='A'&&s1.charAt(i)<='Z'){
                String s=s1.charAt(i)+"";
                String s3=s.toLowerCase();
                s2.append(s3);
            }
        }
        s2.reverse();
        System.out.println(s2.toString());
    }
}
